// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'


export function TableData(TMessageVo) {
  return request({
    url: `/message/selectPage`,
    method: 'get',
    params: TMessageVo
  })
}

export function getRead(TMessageVo) {
  return request({
    url: `/message/selectIsRead`,
    method: 'get',
    params: TMessageVo
  })
}

export function updateMessage(data) {
  return request({
    url: `/message/update`,
    method: 'put',
    data
  })
}

export function delMessage(message_id,receiver_id) {
  return request({
    url: `/message/remove/${message_id}/${receiver_id}`,
    method: 'delete',
  })
}
export function updateIsRead(data) {
  return request({
    url: `/message/updateIsRead`,
    method: 'put',
    data
  })
}

export function selectNotReadMessage(TMessageVo) {
  return request({
    url: `/message/selectNotReadMessage`,
    method: 'get',
    params: TMessageVo
  })
}

export function allRead(data) {
  return request({
    url: `/message/allRead`,
    method: 'put',
    data
  })
}

export function sendMsg(data) {
  return request({
    url: `/message/sendMessage`,
    method: 'post',
    data
  })
}
